<?php
$page = $_GET['page'];

if($page=='library')
{
    $userType = $_COOKIE['userType'];
    $libraryNo = $_COOKIE['libraryNo'];
    
    if($userType == superadministrator)
    {
        echo"'<script>document.location.href='librarylist.php'</script>'";
    }
    else
    {
      echo"'<script>document.location.href='editlibrary.php?libraryNo=$libraryNo'</script>'";
    }
}
if($page=='catalog')
{
    $host  = $_SERVER['HTTP_HOST'];
    $uri  = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra = 'catalogsearch.php';
    header("Location: http://$host$uri/$extra");
}
if($page=='client')
{
    $host  = $_SERVER['HTTP_HOST'];
    $uri  = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra = 'client.php';
    header("Location: http://$host$uri/$extra");
}

if($page=='admin')
{
    $host  = $_SERVER['HTTP_HOST'];
    $uri  = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra = 'adminlist.php';
    header("Location: http://$host$uri/$extra");
}
if($page=='news')
{
    $host  = $_SERVER['HTTP_HOST'];
    $uri  = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra = 'newslist.php';
    header("Location: http://$host$uri/$extra");
}

?>
